package com.manlitech.cloudboot.interfacestore.openfeign;/*
 *Created by Intellij IDEA.
 *User:  Shensg
 *Date:  2021/1/30
 */

import com.manlitech.cloudboot.interfacestore.dto.TestDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

/**
 * 最好独立成为模块
 */
@FeignClient("gateway") // 指向服务提供者应用basebootclient2
public interface EchoService {

    /**
     * 如果应用是有项目名也需要带上
     * @param message
     * @return
     */
    @GetMapping("/basebootclient2/echo/{message}")
    String echo(@PathVariable("message") String message);

    /**
     * 测试token传递
     * @return
     */
    @RequestMapping(value = "/basebootclient2/ping/token")
    String ping(@RequestBody TestDto test , @RequestParam("noHeadToken") String noHeadToken);

    /**
     * 测试get请求下多参数传递问题
     * @SpringQueryMap 可以将其组成map
     * @return
     */
    @RequestMapping(value = "/basebootclient2/ping/token/testget")
    String pingTestGet(@SpringQueryMap TestDto test);

}